define([ 'app', 'angularAMD', 'angular', 'angular-route' ], function(app, angularAMD, angular) {
	configBaseView.$inject = [ '$stateProvider', '$urlRouterProvider', 'pathPrefix', '$controllerProvider' ]
	function configBaseView($stateProvider, $urlRouterProvider, pathPrefix, $controllerProvider) {
		$stateProvider.state('home', {
			url : '/home',
			templateUrl : pathPrefix + 'homepage.html',
			//templateUrl : pathPrefix + 'components/home.html',
			resolve : {
				directive : function($q) {
					var defer = $q.defer()
					require([ 'root/components/common/modal/modal', 'root/components/common/upload/upload' ], function() {
						defer.resolve()
					})
					return defer.promise
				}
			}
		});
		
		$stateProvider.state('organization', {
			url : '/organization',
			templateUrl : pathPrefix + 'organization.html',
			resolve : {
				directive : function($q) {
					var defer = $q.defer()
					require([ 'root/components/common/modal/modal', 'root/components/common/upload/upload' ], function() {
						defer.resolve()
					})
					return defer.promise
				}
			}
		});
		
		
		$stateProvider.state('app.newsview', {
        	url: "/newsview",
        	templateUrl: pathPrefix +"/newsview.html",
        	controller: "newsviewController",
        	resolve: {
                deps: ['$ocLazyLoad', function($ocLazyLoad) {
                    return $ocLazyLoad.load({
                        name: 'app',
                        insertBefore: '#ng_load_plugins_before',
                        files: [
                            'root/asset/js/newsviewController.js'
                        ] 
                    });
                }]
            }
        });
	}
	angularAMD.config(configBaseView)
})